<?php
class Systemuser_model extends CI_Model {

    function __construct()
    {
        parent::__construct();
    }

    /*
	根据用户名查询用户
	$username用户名
    */
    function getuserbyusername($username)
    {
    	$this->load->database();
    	$sql = "SELECT * FROM systemusers WHERE UserName = ? LIMIT 1"; 


		$query = $this->db->query($sql, array($username));

		if ($query->num_rows() > 0)
		{
		   return $query->row(); 		 
		}
		

		//return $this->db->query("SELECT SQL_CALC_FOUND_ROWS * FROM systemusers WHERE UserName='admin';SELECT FOUND_ROWS();");
    }
}

?>